<div class="fm-content">
  <div class="title">
    <i nz-icon [type]="'desktop'"></i> &nbsp;&nbsp;图层配置
  </div>
  <div class="work">
    <div class="top">
      <input nz-input placeholder="名称" class="fm-input first-input" [(ngModel)]="fs.queryObject['name:like']" />
      <nz-select class="fm-input" [(ngModel)]="fs.queryObject['dicType']" (nzOpenChange)="dicTypeDic.load('0')"
        [nzPlaceHolder]="'分组类型'">
        <nz-option *ngFor="let option of dicTypeDic.datas" [nzLabel]="option.display" [nzValue]="option.id">
        </nz-option>
        <nz-option *ngIf="dicTypeDic.isLoading" nzDisabled nzCustomContent>
          <i nz-icon type="loading"></i>加载中...
        </nz-option>
      </nz-select>
      <nz-select class="fm-input" [(ngModel)]="fs.queryObject['type']" (nzOpenChange)="layerType.load('0')"
        [nzPlaceHolder]="'图层类型'">
        <ng-container *ngFor="let option of layerType.datas">
          <nz-option *ngIf="option.id == '13' || option.id == '23'" [nzLabel]="option.display" [nzValue]="option.id">
          </nz-option>
        </ng-container>
        <nz-option *ngIf="layerType.isLoading" nzDisabled nzCustomContent>
          <i nz-icon type="loading"></i>加载中...
        </nz-option>
      </nz-select>
      <nz-button-group class="fm-search-input">
        <button nz-button nzType="primary" (click)="fs.loadData(true)">查询</button>
        <button nz-button (click)="fs.resetQueryObject() && fs.loadData(true)">重置</button>
      </nz-button-group>
      <div class="tool-right">
        <nz-button-group>
          <button nz-button [nzType]="'primary'" (click)="fs.addRow()">新增</button>
        </nz-button-group>
      </div>
    </div>

    <div class="work-content">
      <div class="table">
        <nz-table nzSize="middle" nzShowSizeChanger [nzShowPagination]="false" [nzFrontPagination]="false"
          [nzData]="fs.datas" [nzLoading]="fs.isLoading || fs.isDeleing">
          <thead (nzSortChange)="fs.sort($event)" nzSingleSort>
            <tr>
              <th>名称</th>
              <th>类型</th>
              <th>终端类型</th>
              <th>可用/显示</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
            <ng-template ngFor let-data [ngForOf]="fs.datas">
              <ng-template ngFor let-item [ngForOf]="fs.expandDataCache[data.id]">
                <tr *ngIf="(item.parent&&item.parent.expand)||!(item.parent)">
                  <td (click)="fs.editRow(item)" class="form-edit" [nzIndentSize]="item.level*20"
                    [nzShowExpand]="!item.leaf" [(nzExpand)]="item.expand" (nzExpandChange)="fs.collapse(item,$event)">
                    {{item.name}}
                  </td>
                  <td>{{item.dicTypeName}} {{item.typeName}}</td>
                  <td>{{data.terminalName}}</td>
                  <td>{{item.valid | boolReform}}/{{item.show | boolReform}}</td>
                  <td>
                    <a *ngIf="!item.leaf" (click)="fs.addRow(item)" class="form-button">新增子项</a>
                    <a (click)="fs.editRow(item)" class="form-button">编辑</a>
                    <a nz-popconfirm nzTitle="确认删除选择项?" (nzOnConfirm)="fs.delEntity(item)" nzPlacement="bottomRight"
                      class="form-button">删除</a>
                  </td>
                </tr>
              </ng-template>
            </ng-template>
          </tbody>
        </nz-table>
      </div>
    </div>

    <nz-modal nzWidth='830' nzTitle="编辑" [nzMaskClosable]='false' [nzFooter]="null" [(nzVisible)]="fs.isEditVisible"
      (nzOnCancel)="fs.closeEdit()">
      <form nz-form [nzLayout]="'inline'">
        <div nz-row [nzGutter]="24">

          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">显示名</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="name.invalid?'error':'success'" nzHasFeedback>
                <input nz-input required [(ngModel)]="fs.er.name" id="name" name="name" #name="ngModel">
              </nz-form-control>
            </nz-form-item>
          </div>

          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">分组类型</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="dicType.invalid?'error':'success'"
                nzHasFeedback>
                <nz-select [(ngModel)]="fs.er.dicType" name="dicType" required required #dicType="ngModel"
                  (nzOpenChange)="dicTypeDic.load('0')" [nzPlaceHolder]="'请选择'">
                  <nz-option *ngFor="let option of dicTypeDic.datas" [nzLabel]="option.display" [nzValue]="option.id">
                  </nz-option>
                  <nz-option *ngIf="dicTypeDic.isLoading" nzDisabled nzCustomContent>
                    <i nz-icon type="loading" class="loading-icon"></i>加载中...
                  </nz-option>
                  <span *ngIf="!dicTypeDic.isLoaded">
                    <nz-option [nzLabel]="fs.er.dicTypeName" [nzValue]="fs.er.dicType">
                    </nz-option>
                  </span>
                </nz-select>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
        <div nz-row [nzGutter]="24">

          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">排序</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="order.invalid?'error':'success'" nzHasFeedback>
                <nz-input-number required [(ngModel)]="fs.er.order" name="order" [nzMin]="1" #order="ngModel"
                  [nzStep]="1" class="form-control">
                </nz-input-number>
              </nz-form-control>
            </nz-form-item>
          </div>

          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">属性</nz-form-label>
              <nz-form-control class="form-control">
                <label nz-checkbox [(ngModel)]="fs.er.valid" name="valid">可用</label>
                <label nz-checkbox [(ngModel)]="fs.er.show" name="show">显示</label>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>

        <div nz-row [nzGutter]="24" *ngIf="fs.er.dicType=='2'">

          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">服务名称</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="groupname.invalid?'error':'success'"
                nzHasFeedback>
                <input nz-input required [(ngModel)]="fs.er.groupname" name="groupname" #groupname="ngModel">
              </nz-form-control>
            </nz-form-item>
          </div>

          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">服务类型</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="type.invalid?'error':'success'" nzHasFeedback>
                <nz-select [(ngModel)]="fs.er.type" name="type" required #type="ngModel"
                  (nzOpenChange)="layerType.load('0')" [nzPlaceHolder]="'请选择'">
                  <ng-container *ngFor="let option of layerType.datas">
                    <nz-option *ngIf="option.id == '13' || option.id == '23'" [nzLabel]="option.display"
                      [nzValue]="option.id">
                    </nz-option>
                  </ng-container>
                  <nz-option *ngIf="layerType.isLoading" nzDisabled nzCustomContent>
                    <i nz-icon type="loading" class="loading-icon"></i>加载中...
                  </nz-option>
                  <span *ngIf="!layerType.isLoaded">
                    <nz-option [nzLabel]="fs.er.typeName" [nzValue]="fs.er.type">
                    </nz-option>
                  </span>
                </nz-select>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>


        <div nz-row [nzGutter]="24" *ngIf="fs.er.dicType=='2'">

          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">终端类型</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="terminal.invalid?'error':'success'"
                nzHasFeedback>
                <nz-select [(ngModel)]="fs.er.terminal" name="terminal" required #terminal="ngModel"
                  (nzOpenChange)="terminalType.load('0')" [nzPlaceHolder]="'请选择'">
                  <ng-container *ngFor="let option of terminalType.datas">
                    <nz-option [nzLabel]="option.display" [nzValue]="option.id">
                    </nz-option>
                  </ng-container>

                  <nz-option *ngIf="terminalType.isLoading" nzDisabled nzCustomContent>
                    <i nz-icon type="loading" class="loading-icon"></i>加载中...
                  </nz-option>

                  <span *ngIf="!terminalType.isLoaded">
                    <nz-option [nzLabel]="fs.er.terminalName" [nzValue]="fs.er.terminal">
                    </nz-option>
                  </span>
                </nz-select>
              </nz-form-control>
            </nz-form-item>
          </div>

          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">查询服务地址</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="url.invalid?'error':'success'" nzHasFeedback>
                <input nz-input required [(ngModel)]="fs.er.url" name="url" #url="ngModel">
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>


        <div nz-row [nzGutter]="24" *ngIf="fs.er.dicType=='2'">
          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label class="form-label">空间字段</nz-form-label>
              <nz-form-control class="form-control">
                <input nz-input [(ngModel)]="fs.er.geoField" name="geoField" #geoField="ngModel">
              </nz-form-control>
            </nz-form-item>
          </div>

          <div nz-col [nzSpan]="12">
            <nz-form-item>
              <nz-form-label nzRequired class="form-label">元数据</nz-form-label>
              <nz-form-control class="form-control" [nzValidateStatus]="medname.invalid?'error':'success'"
                nzHasFeedback>
                <nz-tree-select required class="form-control" [(ngModel)]="fs.er.medname" #medname="ngModel"
                  name="medname" nzPlaceHolder="请选择" [nzDropdownMatchSelectWidth]="true"
                  [nzDropdownStyle]="{ 'max-height': '300px' }" [nzAsyncData]="true" [nzNodes]="meDic.treeDatas"
                  (nzOpenChange)="meDic.load('0')" (nzExpandChange)="meDic.expand($event)">
                </nz-tree-select>
              </nz-form-control>
            </nz-form-item>
          </div>

        </div>

        <div nz-row [nzGutter]="24" *ngIf="fs.er.dicType=='2'">
          <div nz-col [nzSpan]="24">
            <nz-form-item>
              <nz-form-label class="form-label">查询配置</nz-form-label>
              <nz-form-control class="form-control3">
                <nz-tabset nzSize="small">
                  <nz-tab nzTitle="过滤条件">
                    <nz-transfer [nzDataSource]="filters" (nzChange)="change($event)" [nzTitles]="['数据结构', '过滤条件']"
                      [nzListStyle]="{ 'width.px': 260 }">
                    </nz-transfer>
                  </nz-tab>
                  <nz-tab nzTitle="标题内容">
                    <nz-transfer [nzDataSource]="titles" (nzChange)="change($event)" [nzTitles]="['数据结构', '标题内容']"
                      [nzListStyle]="{ 'width.px': 260 }">
                    </nz-transfer>
                  </nz-tab>
                  <nz-tab nzTitle="正文内容">
                    <nz-transfer [nzDataSource]="contents" (nzChange)="change($event)" [nzTitles]="['数据结构', '正文内容']"
                      [nzListStyle]="{ 'width.px': 260 }">
                    </nz-transfer>
                  </nz-tab>
                  <nz-tab nzTitle="显示列表">
                    <nz-transfer [nzDataSource]="shows" (nzChange)="change($event)" [nzTitles]="['数据结构', '显示列表']"
                      [nzListStyle]="{ 'width.px': 260 }">
                    </nz-transfer>
                  </nz-tab>
                </nz-tabset>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>

        <div nz-row [nzGutter]="24">
          <div nz-col [nzSpan]="24" class="form-button-align">
            <button nz-button nzType="default" (click)="fs.closeEdit()" class="form-button">取消</button>
            <button nz-button nzType="primary" [disabled]='order.invalid || name.invalid || dicType.invalid'
              (click)="save()" [nzLoading]="fs.isSaveing">保存</button>
          </div>
        </div>
      </form>
    </nz-modal>
  </div>
</div>
No newline at end of file